<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>Phonon.MediaNode Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="../pyqt4ref.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">Phonon.MediaNode Class Reference<br /><sup><sup>[<a href="phonon.html">phonon</a> module]</sup></sup></h1><p>The MediaNode class is the base class for all nodes in a media graph. <a href="#details">More...</a></p>
<p>Inherited by <a href="phonon-abstractaudiooutput.html">AbstractAudioOutput</a>, <a href="phonon-abstractvideooutput.html">AbstractVideoOutput</a>, <a href="phonon-effect.html">Effect</a> and <a href="phonon-mediaobject.html">MediaObject</a>.</p><h3>Methods</h3><ul><li><div class="fn" />list-of-Phonon.Path <b><a href="phonon-medianode.html#inputPaths">inputPaths</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="phonon-medianode.html#isValid">isValid</a></b> (<i>self</i>)</li><li><div class="fn" />list-of-Phonon.Path <b><a href="phonon-medianode.html#outputPaths">outputPaths</a></b> (<i>self</i>)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The MediaNode class is the base class for all nodes in a media graph.</p>
<p>In all phonon applications, one builds a media graph consisting of MediaNodes. The graph will take multimedia content, e.g., from a file, as input. After its nodes have processed the multimedia, the graph will output the media again, e.g., to a sound card.</p>
<p>The multimedia content is streamed over <a href="phonon-path.html">Path</a>s between the nodes in the graph. You can query the paths that are connected to a media node with <a href="phonon-medianode.html#inputPaths">inputPaths</a>() and <a href="phonon-medianode.html#outputPaths">outputPaths</a>().</p>
<p>You can check whether the node is implemented by the current backend by calling <a href="phonon-medianode.html#isValid">isValid</a>(). This does not guarantee that an instance of the class works as expected, but that the backend has implemented functionality for the class.</p>
<p>Currently, Phonon has four media nodes: <a href="phonon-mediaobject.html">MediaObject</a>, <a href="phonon-audiooutput.html">AudioOutput</a>, <a href="phonon-videowidget.html">VideoWidget</a>, and <a href="phonon-effect.html">Effect</a>. Please refer to their class descriptions for details about their usage, and to find out which nodes can be connected to each other. See also <a href="phonon-overview.html#building-graphs">Building Graphs</a> in Phonon's <a href="phonon-overview.html">overview</a> document.</p>
<p>Two nodes are connected to each other using the <a href="phonon-path.html#createPath">Phonon.createPath</a>() or <a href="phonon-path.html#insertEffect">Path.insertEffect()</a> functions (only <a href="phonon-effect.html">Phonon.Effect</a>s use <a href="phonon-path.html#insertEffect">insertEffect()</a>). We show a code example below, in which we build a media graph for video playback and then query its media nodes for their <a href="phonon-path.html">Path</a>s:</p>
<pre>     Phonon.MediaObject *mediaObject = new Phonon.MediaObject;
     Phonon.AudioOutput *audioOutput = new Phonon.AudioOutput;
     Phonon.VideoWidget *videoWidget = new Phonon.VideoWidget;

     Phonon.createPath(mediaObject, audioOutput);
     Phonon.createPath(mediaObject, videoWidget);

     QList&lt;Phonon.Path&gt; inputPaths =
         audioOutput-&gt;inputPaths();   <span class="comment">// inputPaths = [ mediaObject ]</span>
     QList&lt;Phonon.Path&gt; outputPaths =
         mediaObject-&gt;outputPaths(); <span class="comment">// outputPaths = [ audioOutput, videoWidget ]</span></pre>
<p>When you create a Phonon application, you will likely build the graph yourself. This makes <a href="phonon-medianode.html#isValid">isValid</a>() the most useful function of this class. The other two functions help navigate the graph, which you do not need to do as you created the nodes yourself.</p>
<p>See also <a href="phonon-overview.html">Phonon Overview</a>, <a href="phonon-mediaobject.html">Phonon.MediaObject</a>, <a href="phonon-audiooutput.html">Phonon.AudioOutput</a>, <a href="phonon-videowidget.html">Phonon.VideoWidget</a>, and <a href="phonon-module.html">Phonon Module</a>.</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="inputPaths" />list-of-Phonon.Path MediaNode.inputPaths (<i>self</i>)</h3><p>Returns the paths that inputs multimedia to this media node.</p>
<p>See also <a href="phonon-medianode.html#outputPaths">outputPaths</a>().</p>
<a name="//apple_ref/cpp/instm/Phonon::MediaNode/isValid" />
<h3 class="fn"><a name="isValid" />bool MediaNode.isValid (<i>self</i>)</h3><p>Returns true if the backend provides an implementation of this class; otherwise returns false.</p>
<p>This does not guarantee that instances of the class works as expected, but that the backend has implemented the functionality for this class. For instance, Qt's GStreamer backend will return true for instances of the <a href="phonon-audiooutput.html">AudioOutput</a> class, even if there is a problem with GStreamer and it could not play sound.</p>
<a name="//apple_ref/cpp/instm/Phonon::MediaNode/outputPaths" />
<h3 class="fn"><a name="outputPaths" />list-of-Phonon.Path MediaNode.outputPaths (<i>self</i>)</h3><p>Returns the paths to which this media node outputs media.</p>
<p>See also <a href="phonon-medianode.html#inputPaths">inputPaths</a>().</p>
<p /><address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;snapshot-4.7.1-5014f7c72a58 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2010</td><td align="right" width="25%">Qt&#160;4.6.1</td></tr></table></div></address></body></html>